'use strict';
	angular.module('invoice.payableCGFPDetailQueryList', ['app.services'])

	.controller('payableCGFPDetailQueryListCtrl',['$rootScope', '$scope', 'BizData', f])
    function f($rootScope, $scope, BizData) {

		var Model = this;
		
		var options = {};
		options.container = Model;
		options.concept = 'AccountInvoiceDetail';
		options.name = 'dataMaster';
		options.url = $rootScope.path;
		options.httpUrl = $rootScope.getServiceName();
		options.reader = '/invoice/accountInvoiceDetail/query';
		options.writer = '';
		options.deleter = '';
		options.idColumnDefine = "fID";
		options.idColumnName = "fID";
		options.isTree = false;
		options.parentRelation = 'fParent';
		options.nodeKindRelation = 'nodeKind';
		options.nodeLevelRelation = 'nodeLevel';
		options.pathRelation = '';
		options.master = {"data":"","relation":""};
		options.directDeleteMode = false;
		options.orderBy = 'accountInvoiceNo ASC, serialNo';
		options.limit = 15
		
		//聚合列
		options.aggregateColumns = {"itemAmount":{name:"sumItemAmount",type:"Decimal",label:""},"orderAmountTotal":{name:"sumOrderAmountTotal",type:"Decimal",label:""},"orderAmountTax":{name:"sumOrderAmountTax",type:"Decimal",label:""},"orderAmountOld":{name:"sumOrderAmountOld",type:"Decimal",label:""}};

		Model.dataMaster = new BizData(options);

		//设置过滤条件
		Model.dataMaster.filter = " AccountInvoiceDetail.billType='CGFP' "
			+ " AND AccountInvoiceDetail.audit='confirm' "
		;

		//刷新数据
		Model.dataMaster.refreshData();
//		console.log('Model.dataMaster-->',Model.dataMaster);
		////////////////////启动执行结束///////////////////////////////////////////////////
	    
		Model.refresh = function(){
			Model.dataMaster.refreshData();
		}
	    
	    return Model;
		
	}	
	
